/*    */ package btsm.bean;
/*    */ 
/*    */ import java.io.PrintStream;
/*    */ import java.sql.ResultSet;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ 
/*    */ public class sysParam
/*    */ {
/* 16 */   private String strSql = "";
/* 17 */   private String strTable = "";
/*    */   dbConnector dbcon;
/*    */   ResultSet rs;
/*    */ 
/*    */   public sysParam(String tableswa)
/*    */   {
/* 25 */     this.strTable = tableswa;
/* 26 */     this.dbcon = new dbConnector();
/*    */   }
/*    */ 
/*    */   public String GetParam(String strParam)
/*    */     throws Exception
/*    */   {
/* 32 */     this.strSql = ("select paravalue from " + this.strTable + " where paracode = \"" + strParam + "\"");
/* 33 */     this.strSql = new String(this.strSql.getBytes("ISO8859-1"), "UTF-8");
/* 34 */     this.rs = this.dbcon.execQuery(this.strSql);
/* 35 */     this.rs.next();
/* 36 */     return this.rs.getString(1);
/*    */   }
/*    */ 
/*    */   public Map getBtsLIs(String strParam) throws Exception
/*    */   {
/* 41 */     Map map = new HashMap();
/* 42 */     this.strSql = ("select * from " + this.strTable + " where paracode like \"" + strParam + "%\"");
/* 43 */     this.strSql = new String(this.strSql.getBytes("ISO8859-1"), "UTF-8");
/* 44 */     this.rs = this.dbcon.execQuery(this.strSql);
/* 45 */     while (this.rs.next()) {
/* 46 */       map.put(this.rs.getString("paracode"), this.rs.getString("paravalue"));
/* 47 */       System.out.println("paracode:  " + this.rs.getString("paravalue"));
/*    */     }
/* 49 */     return map;
/*    */   }
/*    */ 
/*    */   public Map getInterconsys() throws Exception {
/* 53 */     Map map = new HashMap();
/* 54 */     this.strSql = ("select isname, isurl from " + this.strTable + " order by id;");
/* 55 */     this.strSql = new String(this.strSql.getBytes("ISO8859-1"), "UTF-8");
/* 56 */     this.rs = this.dbcon.execQuery(this.strSql);
/* 57 */     int i = 0;
/* 58 */     while (this.rs.next()) {
/* 59 */       map.put("isname" + String.valueOf(i), this.rs.getString("isname"));
/* 60 */       map.put("isurl" + String.valueOf(i), this.rs.getString("isurl"));
/* 61 */       i++;
/*    */     }
/* 63 */     return map;
/*    */   }
/*    */ 
/*    */   public boolean updateParam(String strParam, String strValue) throws Exception
/*    */   {
/* 68 */     this.strSql = ("update " + this.strTable + " set paravalue = \"" + strValue + "\" where paracode = \"" + strParam + "\";");
/* 69 */     this.strSql = new String(this.strSql.getBytes("ISO8859-1"), "UTF-8");
/* 70 */     System.out.println("sysconfigLGsql:" + this.strSql);
/* 71 */     this.dbcon.execUpdate(this.strSql);
/* 72 */     return true;
/*    */   }
/*    */ 
/*    */   public boolean updateParamBQ(String strParam, String strValue)
/*    */     throws Exception
/*    */   {
/* 78 */     this.strSql = ("update " + this.strTable + " set paravalue = \"" + strValue + "\" where paracode like \"" + strParam + "%\";");
/* 79 */     this.strSql = new String(this.strSql.getBytes("ISO8859-1"), "UTF-8");
/* 80 */     System.out.println("updateParamBQ:" + this.strSql);
/* 81 */     this.dbcon.execUpdate(this.strSql);
/* 82 */     return true;
/*    */   }
/*    */ 
/*    */   public boolean releaseRes() throws Exception {
/* 86 */     this.dbcon.closeAll();
/* 87 */     return true;
/*    */   }
/*    */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     btsm.bean.sysParam
 * JD-Core Version:    0.6.2
 */